package com.csi.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.sql.Timestamp;

/**
 * 员工表
 */
@Schema(description = "员工信息")
@Data
public class Employee {
    @Schema(description = "员工ID", required = true)
    private long id; //员工id

    @Schema(description = "员工用户名", required = true)
    private String username; //员工用户名

    @Schema(description = "员工密码", required = true)
    private String password; //员工密码

    @Schema(description = "员工姓名", required = true)
    private String name; //员工姓名

    @Schema(description = "员工手机号", required = true)
    private String phone; //员工手机号

    @Schema(description = "员工身份证号")
    private String idCard; //员工身份证号

    @Schema(description = "员工地址")
    private String userAddress; //员工地址

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd") //转换时间格式
    @Schema(description = "入职时间")
    private Timestamp entryTime; //入职时间

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Schema(description = "离职时间")
    private Timestamp leaveTime; //离职时间

    @Schema(description = "性别", required = true)
    private int sex; //性别

    @Schema(description = "入职办理人ID", required = true)
    private long createId; //入职办理人id

    @Schema(description = "酒店ID", required = true)
    private long hotelId;

    @Schema(description = "旅行社ID", required = true)
    private long travelId; //旅行社id

    @Schema(description = "离职处理人ID")
    private long handleId; //离职处理人id

    @Schema(description = "角色ID", required = true)
    private long roleId; //角色id

    @Schema(description = "登录类型", required = true)
    private String type; //登录类型(平台/酒店/旅行社)

    @Schema(description = "类型对应的id", required = true)
    private long typeNameId;  //对应的id(因为酒店和旅行社是两张表)
}
